/**
 * author:Administrator
 * date:2013-5-21
 */
package com.roc.web.action;

import java.util.ArrayList;
import java.util.List;

import com.roc.page.BaseSearchCondition;
import com.roc.page.WhereHQLFieldBean;
import com.roc.util.Constance;

/**
 * 
 * @author zx
 *
 */
public class TidRecordQuerySearchCondition extends BaseSearchCondition {
	


	private String minDate;//开始时间
	private String maxDate;//结束时间 
	private String askType;
	private String posType;
	private String posBrand;
	private String posName;

	/* (non-Javadoc)
	 * @see com.roc.page.BaseSearchCondition#getOrderPartOfHQL()
	 */
	@Override
	protected String getOrderPartOfHQL() {
		// TODO Auto-generated method stub
		
		return "   ";
	}

	/* (non-Javadoc)
	 * @see com.roc.page.BaseSearchCondition#getRowCountHQL()
	 */
	@Override
	protected String getRowCountHQL() {
		
		return " select count(*) from TidRecord o where 1=1  ";
		
	}

	/* (non-Javadoc)
	 * @see com.roc.page.BaseSearchCondition#getSearchHQL()
	 */
	@Override
	protected String getSearchHQL() {
		
		StringBuffer sql = new StringBuffer();
		sql.append("");
		
		String hql = " from TidRecord o where 1=1  ";
		return hql;
	}

	/* (non-Javadoc)
	 * @see com.roc.page.BaseSearchCondition#getWhereHQLFieldBeanList()
	 */
	@Override
	protected List<WhereHQLFieldBean> getWhereHQLFieldBeanList() {
		List<WhereHQLFieldBean> filedBeanList = new ArrayList<WhereHQLFieldBean>();

		
		if (Constance.isNotEmpty(askType)) {
			filedBeanList.add(new WhereHQLFieldBean("o.orgCode", askType.trim(), "=", false));
		}
		if (Constance.isNotEmpty(posType)) {
			filedBeanList.add(new WhereHQLFieldBean("o.posType", posType.trim(), "=", false));
		}
		if (Constance.isNotEmpty(posBrand)) {
			filedBeanList.add(new WhereHQLFieldBean("o.posBrand", posBrand.trim(), "=", false));
		}
		if (Constance.isNotEmpty(posName)) {
			filedBeanList.add(new WhereHQLFieldBean("o.posName", posName.trim(), "=", false));
		}
		
		return filedBeanList;
	}

	public String getAskType() {
		return askType;
	}

	public void setAskType(String askType) {
		this.askType = askType;
	}

	public String getPosType() {
		return posType;
	}

	public void setPosType(String posType) {
		this.posType = posType;
	}

	public String getPosBrand() {
		return posBrand;
	}

	public void setPosBrand(String posBrand) {
		this.posBrand = posBrand;
	}

	public String getPosName() {
		return posName;
	}

	public void setPosName(String posName) {
		this.posName = posName;
	}

	public String getMinDate() {
		return minDate;
	}

	public void setMinDate(String minDate) {
		this.minDate = minDate;
	}

	public String getMaxDate() {
		return maxDate;
	}

	public void setMaxDate(String maxDate) {
		this.maxDate = maxDate;
	}

}
